<%@ page contentType="text/html;charset=UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<!DOCTYPE html>
<html lang="zh-CN" >
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
<meta name="format-detection" content="telephone=no" />
<title>设置个人资料</title>
<link rel="stylesheet" type="text/css" href="${ctxStatic}/member/themes/fashion/css/user.css" />

<script src="${ctxStatic}/jquery/jquery-1.9.1.min.js" type="text/javascript"></script>
<script language="javascript" type="text/javascript" src="${ctxStatic}/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript">
$(document).ready(function() {
	$("#errorMessage").hide()
	var sex = $("#msex").val();
	$(":radio[name='sex'][value='"+sex+"']").attr("checked","true"); 
	
});
function checkForm(){
	var nick = $.trim($('#nickName').val());
	var tel = $.trim($('#mobile').val());
	var email = $.trim($('#email').val());
	var val=$('input:radio[name="sex"]:checked').val();
	if(nick == null || nick ==''){
		$("#errorMessage").html("请输入姓名");
		$("#errorMessage").show();
		return false;
	}else{
		
		var length = nick.replace(/[^\x00-\xff]/g,"**").length;
		if(length<4 || length>8){
			$("#errorMessage").html("请输入2-4个中文名称。");
			$("#errorMessage").show();
			return false;
		}
		
		if(val==null){
			$("#errorMessage").html("请输选择性别");
			$("#errorMessage").show();
			return false;
		}else{
			if(tel == null || tel ==''){
				$("#errorMessage").html("请输入手机号");
				$("#errorMessage").show()
				return false;
			}else{
				if(/^1[3,4,5,8]\d{9}$/g.test(tel)||(/^15[8,9]\d{8}$/g.test(tel))){
					if(email == null || email ==''){
						$("#errorMessage").hide();
						return true;
					}else{
						var re = /^(\w-*\.*)+@(\w-?)+(\.\w{2,})+$/;
						if(re.test(email)){
							$("#errorMessage").hide();
							return true;
						}else{
							$("#errorMessage").html("邮箱输入不正确。");
							$("#errorMessage").show()
							return false;
					    }
					}
				}else{
					$("#errorMessage").html("手机号输入不正确。");
					$("#errorMessage").show()
					return false;
				}
			}
		}
	}
	/* 
	if(tel == null || tel ==''){
		$("#errorMessage").html("请输入手机号");
		$("#errorMessage").show()
		return false;
	}else{
		$("#errorMessage").hide();
		return true;
	}
	 */
}
</script>
<style type="text/css">
.message-input{ width:60%;}
.message-tit{width: 25%; }
.bd{margin-left: 20px;}
</style>
</head>
<body>
<div class="body">
  <div class="backg" style="min-height: 460px;">

   <div class="bd">
   				
   				<input type="hidden" id="msex" value="${wechatMember.sex }">
   	
   				<form id="inputForm" action="${ctxFront}/member/updatePersonInformation?uid=${uid}"
						method="post" onsubmit=" return checkForm();">
						<input type="hidden" name="topage" value="${topage }" /> <input
							type="hidden" name="wechatId" value="${wechatId }" /> <input
							type="hidden" name="style" value="${style}" />
							<input type="hidden" name="mid" value="${wechatMember.id  }" />
              <ul>
                <li>
                  <div class="message-tit" >姓<span style="color: #eee">一一</span>名：</div>
                  <input name="name" id="nickName" class="message-input" type="text" maxlength="15" value="${wechatMember.name }" ></li>
                <li>
                 <div class="message-tit">性<span style="color: #eee">一一</span>别：</div>
                 <label class="message-input2"><input type="radio" name ="sex" value="男" class="message-input2"  />男</label>
				 <label class="message-input2"><input type="radio" name ="sex" value="女" class="message-input2"/>女</label>
				<!-- <label class="message-input2"><input type="radio" name ="sex" value="保密"  class="message-input2" />保密</label> -->
				</li>
				<li>
                  <div class="message-tit">手<span style="color: #eee">一一</span>机：</div>
                  <input name="mobile" id="mobile" type="text" onkeyup="(this.v=function(){this.value=this.value.replace(/[^0-9]/,'');}).call(this)" onblur="this.v();" maxlength="11" value="${wechatMember.mobile}" class="message-input"  />
                </li>
                
                <li>
                  <div class="message-tit">身份证号：</div>
                  <input name="IDCardNumber" type="text" class="message-input" type="text" maxlength="18" value="${wechatMember.IDCardNumber }"/>
                </li>
                <li>
                  <div class="message-tit">邮<span style="color: #eee">一一</span>箱：</div>
                  <input name="email" id="email" type="text" class="message-input" type="text" value="${wechatMember.email }"/>
                </li>
                
                <li>
                  <div class="message-tit">生<span style="color: #eee">一一</span>日：</div>
                 <input name="birthday"  type="text" id="d243"  onfocus="WdatePicker({skin:'whyGreen',dateFmt:'yyyyMMdd'})" value="${wechatMember.birthday }" class="message-input"  />
                  </li>
               	<br/>
                  <span> <font color="red">${message}</font></span>
               	<br/>
				<div  align="center" class="alert" id="errorMessage" style="color:red;">
				${message}
				</div>
				
                <div class="message-tool">
                  <input class="message-btn" value="确 定" type="submit">
                </div>
              </ul>
              
              </form>
            </div>
</div>
            <c:if test="${uid ne '34' }">
		 <div class="footer">
        <p><!-- 版权所有&copy;&nbsp;&nbsp;  --><br>
		技术支持：<a href="http://www.hdzhx.com/boxin/index.html" >智讯互联</a><!-- &nbsp;&nbsp;	
		<a href="tel:03107056607">0310-7056607</a> -->
      </div>
	</c:if>
  </div>
</body>
</html>
